package com.atguigu.springcloud.service;

import com.atguigu.springcloud.entities.CommonResult;
import com.atguigu.springcloud.entities.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Component
@FeignClient(value = "CLOUD-PAYMENT-SERVICE") //8001微服务名称
//使用方式：微服务调用接口+注解 即->提供方8001微服务调用接口PaymentService+@FeignClient
public interface PaymentFeignService {

    @GetMapping("/payment/get/{id}")//这是8001微服务接口地址
    CommonResult<Payment> getPaymentById(@PathVariable("id") Long id);

    @GetMapping(value = "/payment/feign/timeout")//超时控制
    String paymentFeignTimeOut();
}
